package com.wushi.lenovo.asia5b.app_model.profile;

import android.text.TextUtils;

import com.google.gson.annotations.SerializedName;
import com.mvp.base.model.BaseModel;

/**
 * Created by zhangyuncai on 2018/9/29.
 */
public class AddressModel extends BaseModel {

    public String getLocalAddressDetail() {
        StringBuilder stringBuilder = new StringBuilder();
        if (!TextUtils.isEmpty(getAddress())) {
            stringBuilder.append(getAddress());
            stringBuilder.append(" ");
        }
        if (!TextUtils.isEmpty(getPostcode_no())) {
            stringBuilder.append(getPostcode_no());
            stringBuilder.append(" ");
        }
        if (!TextUtils.isEmpty(getCity())) {
            stringBuilder.append(getCity());
            stringBuilder.append(" ");
        }
        if (!TextUtils.isEmpty(getState())) {
            stringBuilder.append(getState());
            stringBuilder.append(" ");
        }
        if (!TextUtils.isEmpty(getCountry())) {
            stringBuilder.append(getCountry());
        }
        return stringBuilder.toString();
    }

    private boolean isShipAddressDefault;//默认收货地址
    private boolean isBillAddressDefault;//默认账单收货地址

    public boolean isShipAddressDefault() {
        return isShipAddressDefault;
    }

    public void setShipAddressDefault(boolean shipAddressDefault) {
        isShipAddressDefault = shipAddressDefault;
    }

    public boolean isBillAddressDefault() {
        return isBillAddressDefault;
    }

    public void setBillAddressDefault(boolean billAddressDefault) {
        isBillAddressDefault = billAddressDefault;
    }

    /**
     * id : 9
     * address : address1
     * contact_name : zhangsan
     * calling_code : 60
     * contact_no : 15889636926
     * country : Malaysia
     * state : Pahang
     * city : Balok
     * postcode_no : 334455
     * other_postcode : null
     * building_name : null
     */

    private int id;//
    private String address;//详细地址
    @SerializedName(value = "contact_name", alternate = {"name"})
    private String contact_name;//联系人姓名
    private int calling_code;//国家编码
    @SerializedName(value = "contact_no", alternate = {"mobile"})
    private String contact_no;//电话号码
    @SerializedName(value = "country", alternate = {"country_name"})
    private String country;//国家
    private String state;//省
    private String city;//城市
    @SerializedName(value = "postcode_no", alternate = {"postcode"})
    private String postcode_no;//邮编
    private String other_postcode;//
    private String building_name;//
    private int city_id;
    private int country_id;
    private int state_id;

    public int getCity_id() {
        return city_id;
    }


    public int getCountry_id() {
        return country_id;
    }


    public int getState_id() {
        return state_id;
    }


    public int getId() {
        return id;
    }


    public String getAddress() {
        if (TextUtils.isEmpty(address)) {
            return "";
        }
        return address;
    }


    public String getContact_name() {
        if (TextUtils.isEmpty(contact_name)) {
            return "";
        }
        return contact_name;
    }


    public int getCalling_code() {
        return calling_code;
    }


    public String getContact_no() {
        if (TextUtils.isEmpty(contact_no)) {
            return "";
        }
        return contact_no;
    }


    public String getCountry() {
        if (TextUtils.isEmpty(country)) {
            return "";
        }
        return country;
    }


    public String getState() {
        if (TextUtils.isEmpty(state)) {
            return "";
        }
        return state;
    }


    public String getCity() {
        if (TextUtils.isEmpty(city)) {
            return "";
        }
        return city;
    }


    public String getPostcode_no() {
        if (TextUtils.isEmpty(postcode_no)) {
            return "";
        }
        return postcode_no;
    }


    public String getOther_postcode() {
        return other_postcode;
    }


    public String getBuilding_name() {
        if (TextUtils.isEmpty(building_name)) {
            return "";
        }
        return building_name;
    }

}
